package com.hzm.controller;



import com.hzm.service.PayService;
import com.hzm.utils.Result;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;



@RestController
@RequestMapping("/order/pay")
public class WXPayController {

    @Resource
    private PayService payService;

    /**
     * 生成支付的二维码接口
     * @param
     * @return
     */
    @PostMapping("/createWeiXin/{id}/{HuiYuanId}")
    public Result createWeiXin(@PathVariable("id") String id, @PathVariable("HuiYuanId") String HuiYuanId){
        Result result = payService.createWeiXin(id, HuiYuanId);
        return result;
    }
    //获取支付的状态
    @PostMapping("getPayStatus/{orderNo}")
    public Result getPayStatus(@PathVariable String orderNo){

        return payService.getStatus(orderNo);
    }










}
